package org.jeecg.modules.rest.service.Impl;

import com.alibaba.fastjson.JSONObject;
import org.jeecg.config.thirdapp.ThirdAppConfig;
import org.jeecg.modules.rest.handle.CommonSmsWlwxRestHandle;
import org.jeecg.modules.rest.service.ISMSCommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SmsCommonServiceImpl extends CommonSmsWlwxRestHandle implements ISMSCommonService {

    @Autowired
    ThirdAppConfig thirdAppConfig;

    @Override
    public JSONObject sendSms(String apiPath, JSONObject smsObject) {
        /***
         *
         * SmsReq req = new SmsReq();
         * req.setUid(uid);                 [选填] 业务标识，由贵司自定义32为数字透传至我司
         * req.setCust_code(custCode);      [必填] 用户账号
         * req.setContent(content);         [必填] 短信内容
         * req.setDestMobiles(destMobiles); [必填] 接收号码，同时发送给多个号码时,号码之间用英文半角逗号分隔(,)
         * req.setNeed_report(needReport);  [选填] 状态报告需求与否，是 yes 否 no 默认yes
         * req.setSp_code(spCode);          [选填] 长号码
         * req.setMsgFmt(msgFmt);           [选填] 信息格式，0：ASCII串；3：短信写卡操作；4：二进制信息；8：UCS2编码；默认8
         */
        return this.postRest(thirdAppConfig.getSmsWlwx(),apiPath,smsObject);
    }
}
